<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .bigBox {
            width: 300px;
            height: 300px;
            background-color: chartreuse;
        }
        .smallBox {
            width: 100px;
            height: 100px;
            background-color: chocolate;
        }
    </style>
</head>
<body>
    <div class="bigBox">
        <div class="smallBox">

        </div>
    </div>
    <script>
        var boxEle = document.querySelector(".bigBox");
        var divEle = document.querySelector(".smallBox");
        document.body.addEventListener("click",function(e){
            e.target.style.backgroundColor = "red" ;
        });
        // boxEle.addEventListener("click",function(){
        //     boxEle.style.backgroundColor = "red" ;
        // });
        // divEle.addEventListener("click",function(e){
        //     // e.stopPropagation();
        //     e.cancelBubble = true ;
        //     divEle.style.backgroundColor = "black" ;
        // });
        
    </script>
</body>
</html>